<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>优惠券管理</title>
		<link rel="stylesheet" type="text/css" href="css/cxzx.css"/>
	</head>
	<body>
		<div class="main_content">
			<div class="con_left">
				<div class="l-box in">
					<a href="cxzx.html">优惠券管理</a>
				</div>
				<div class="l-box">
					<a href="cxzx2.html">促销模式设置</a>
				</div>
				<div class="l-box">
					<a href="cxzx3.html">押金设置</a>
				</div>
			</div>
			<div class="con_right fl">
				<div class="r_main">
					<table border="1" cellspacing="0" cellpadding="0">
						<tr>
							<th style="width: 20px;">
			                    <input type="checkbox" ></th>
			                <th style="width: 30px;">序号</th>
			                <th style="width: 50px;">编辑</th>
			                <th style="width: 70px;">优惠劵明细</th>
			                <th>优惠劵名称</th>
			                <th style="width: 120px;">优惠劵总数</th>
			                <th style="width: 120px;">已领取总数</th>
			                <th style="width: 120px;">已使用总数</th>
			                <th style="width: 150px;">添加日期</th>
						</tr>
						<tr>
							<td></td>
							<td></td>
							<td><a href="#" onclick="tangchu(0)"><img src="img/xiugai.png"/></a></td>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
						</tr>
					</table>
					<div class="jintui">
						<button id="xinzeng" onclick="tangchu(1)">新增</button>
						<button id="shangchu">删除</button>
					</div>
						
				</div>
			</div>
			<div class="mask">
			</div>
			<form action="" method="post" style="position: absolute;z-index: 200;">
				<div id="openWindowModal" class="modal in">   
				    <div class="modal-header">
				        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				        <h3>添加优惠劵</h3>  
				    </div>
				    <div class="modal-body">
						<div class="info-con">
							<div class="alert-info">
							    <button type="button" class="close1" data-dismiss="alert">×</button>
							    <strong>提示!</strong>&nbsp;&nbsp; 添加成功后,点击优惠券明细. 可点击上传SN码生成（点击下载示例按要求上传）.也可点击添加,系统生成SN码.
							</div>
							<p>优惠券名称：</p><input type="text" name="" id="input1" value=""><span style="color: red;display: none;">*</span>
						</div>
				    </div>
				    <div class="modal-footer">
				        <button id="openWindowBtn" class="btn btn-primary" type="submit">确 定</button>
				        <button class="btn cancel" data-dismiss="modal" aria-hidden="true" type="button">取 消</button>
				    </div>
				</div>
			</form>
		</div>
		<script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var bw=$('body').width();
			$('.mask').width(bw-247);
			function tangchu(a){//0为修改，1为添加。
				if(a){
					$('#openWindowModal .modal-header h3')[0].innerText='添加优惠劵';
				}else{
					$('#openWindowModal .modal-header h3')[0].innerText='修改优惠劵';
				}
				$(".mask").fadeIn();
				$("#openWindowModal").fadeIn();
				$(".alert-info").css('display','block');
			}
//			$('.xiugai').on('click',function(){
//				$(".mask").fadeIn();
//				$("#openWindowModal1").fadeIn();
//			})
//			$($("#xinzeng").on('click',function(){
//				$(".mask").fadeIn();
//				$("#openWindowModal").fadeIn();
//				$(".alert-info").css('display','block');
//			}))
			$(".close").on('click',function(){
				$(".mask").fadeOut();
				$("#openWindowModal").fadeOut();
				$("#openWindowModal1").fadeOut();
			})
			$(".cancel").on('click',function(){
				$(".mask").fadeOut();
				$("#openWindowModal").fadeOut();
				$("#openWindowModal1").fadeOut();
			})
			$(".close1").on('click',function(){
				$(".alert-info").css('display','none');
			})
			$(".mask").on('click',function(){
				$(".mask").fadeOut();
				$("#openWindowModal").fadeOut();
				$("#openWindowModal1").fadeOut();
			})
			$('.btn-primary').on('click',function(){
				var input1=$.trim($('#input1').val());
				if(!input1){
					$('#input1').nextAll().eq(0).css('display','inline-block');
					return false;
				}else{
					return true;
				}
				
			})
		</script>
	</body>
</html>